package com.m.InnerClass;

public class Outer {
    public static String NAME = "OUTER";
    public String name;
    public Outer(String name) {
        this.name = name;
    }

    public static class StaticNested {
        //静态内部类
        public void hello() {
            System.out.println("HELLO," + Outer.NAME);
        }
    }

    public class Inner {
        //定义了一个内部类
        public void Hello() {
            System.out.println("Hello," + Outer.this.name);
        }
    }

    public void asyncHello() {
        //匿名内部类
        Runnable r = new Runnable() {
            public void run() {
                System.out.println("Hello," + Outer.this.name);
            }
        };
        new Thread(r).start();
    }
}
